package com.rd.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.rd.common.vo.AdminStatusVO;
import com.rd.common.vo.UpdateAvatarFormData;
import com.rd.common.vo.UpdatePwdFormData;
import com.rd.pojo.Admin;
import com.rd.pojo.Role;
import com.rd.util.ResultModel;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author qiufenfen
 * @since 2023-10-26
 */
public interface IAdminService extends IService<Admin> {

    /**admin登录*/
    ResultModel login(String username, String password, String code, HttpServletRequest request);

    /**根据用户名查找Admin详细信息*/
    Admin getAdminInfo(String username);


    /**
     *根据用户id获取用户角色
     */
    List<Role> getRoles(Integer adminId);

    /**根据关键字获取所有的账户*/
    ResultModel getAllAdmins(String keywords);

    /**修改账户的角色*/
    ResultModel updateAdminRole(Integer adminId, Integer[] rids);

    /**根据id修改用户的状态*/
    ResultModel updateStatusById(AdminStatusVO adminStatusVO);

    /*个人中心*/
    ResultModel updateAdminInfo(Admin admin);

    ResultModel checkOldPwd( Integer userId, String oldPassword);

    int updateAvatar(UpdateAvatarFormData imgForm);

    int updatePwd(UpdatePwdFormData pwdForm);
}
